package de.koller.worlders.gameplay.gui;

import de.koller.oceanFramework.glyph.GlyphRendererGL;
import de.koller.oceanFramework.glyph.GlyphScreenGL;
import de.koller.oceanFramework.tree.Child;
import de.koller.worlders.WSea;
import de.koller.worlders.WorldersRoot;
import de.koller.worlders.gameplay.resource.FontValue;
import de.koller.worlders.render.IGLRender;

public class PausedScreen extends WSea implements IGLRender {

	@Child private final GlyphScreenGL gscreen = new GlyphScreenGL( 400, 300,
			new FontValue(), "de/koller/worlders/gameplay/resource/font.png" );

	@Override
	protected void postChildInit() {
		super.postChildInit();
		
		for( int x = 0; x < 100; x++ )
			for( int y = 0; y < 100; y++ )
				gscreen.clearGlyph( x, y, 0xc0000000 );
		
		GlyphRendererGL r = gscreen.getRenderer();
		r.setCurrentBackColor( 0xc0000000 );
		r.setCurrentFontColor( 0xffffffff );
		
		r.renderString(  8, 6, "Paused..." );
		r.renderString( 10, 8, "press [ESC] to resume" );
		
		gscreen.updateBuffer();
	}
	
	@Override
	public void renderGL( int elapsedTime ) {
		gscreen.getTexture().draw2D( 0, 0, WorldersRoot.D_WIDTH, WorldersRoot.D_HEIGHT, 100 );
		wroot.getInput().setMouseGrab( false );
	}
	
}
